package ai.xiaodao.trade;

import com.futu.openapi.pb.TrdCommon;

public class LocalOrder {
    long orderid;
    String code;
    int market;
    int trdSide;
    double trdQty;
    double price;
    int status;
    String date;
    int orderType = TrdCommon.OrderType.OrderType_Normal_VALUE;

    /**
     * 用于本地存储
     * @param orderid
     * @param code
     * @param market
     * @param trdSide
     * @param trdQty
     * @param price
     * @param date
     * @param status
     */
    public LocalOrder(long orderid, String code, int market, int trdSide, double trdQty, double price, String date, int status) {
        this.orderid = orderid;
        this.code = code;
        this.market = market;
        this.trdSide = trdSide;
        this.trdQty = trdQty;
        this.price = price;
        this.date = date;
        this.status = status;
    }

    /**
     * 用于提交订单
     * @param code
     * @param market
     * @param trdSide
     * @param trdQty
     * @param price
     */

    public LocalOrder( String code, int market, int trdSide, double trdQty, double price) {
        this.code = code;
        this.market = market;
        this.trdSide = trdSide;
        this.trdQty = trdQty;
        this.price = price;
    }

    public int getOrderType() {
        return orderType;
    }

    public void setOrderType(int orderType) {
        this.orderType = orderType;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public int getMarket() {
        return market;
    }

    public void setMarket(int market) {
        this.market = market;
    }

    public int getTrdSide() {
        return trdSide;
    }

    public void setTrdSide(int trdSide) {
        this.trdSide = trdSide;
    }

    public Double getTrdQty() {
        return trdQty;
    }

    public void setTrdQty(int trdQty) {
        this.trdQty = trdQty;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Long getOrderID() {
        return orderid;
    }

    public void setOrderid(Long orderid) {
        this.orderid = orderid;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    @Override
    public String toString() {
        return "LocalOrder{" +
                "orderid=" + orderid +
                ", code='" + code + '\'' +
                ", market=" + market +
                ", trdSide=" + trdSide +
                ", trdQty=" + trdQty +
                ", price=" + price +
                ", status=" + status +
                ", date='" + date + '\'' +
                ", orderType=" + orderType +
                '}';
    }
}
